<html>
	<head>
		<script>
			data =    '[Event "39th Olympiad Khanty-Mansiysk 2010"]\n'
				+ '[Site "Khanty-Mansiysk/Russia"]\n\n'
				+ "1. e4 c5 2. Nc3 a6 3. Nge2 d6 4. g3 Nc6 5. Bg2 g6 6. d3 Bg7 7. Be3 Nf6 8. h3\n"
				+ "Bd7 9. Qd2 b5 10. Bh6 Bxh6 11. Qxh6 Nd4 12. Nxd4 cxd4 13. Ne2 e5 14. O-O Ng8";
			function exportData(data, target) {
				var exportLink = document.createElement('a');
				exportLink.setAttribute('href', 'data:application/x-chess-pgn;base64,' + window.btoa(data));
				exportLink.appendChild(document.createTextNode('sample.pgn'));
				document.getElementById(target).appendChild(exportLink);
			}
		</script>
	</head>
	<body onload="exportData(data,'d1');">
		<h2 id='h2' >Testing data:URI</h2>
		<div id='d1'>Download will go here<br/></div>
	</body>
</html>

